#!/usr/bin/python

import math

def main():
    c = 0
    bit = 1
    while bit<22:
        print 'bit = ' + str(bit)
        print '*******************************'
        m = 10**bit
        n = int(math.ceil(10**((bit-1.0)/bit)))
        while n**bit<m:
            print str(n) + '**' + str(bit) + '=' + str(n**bit)
            c += 1
            n += 1
        bit += 1
    print c


if __name__=='__main__':
    main()
    
